package com.pig4cloud.pig.djjk.controller;

import cn.hutool.json.JSONObject;


import com.pig4cloud.pig.common.security.annotation.Inner;
import com.pig4cloud.pig.djjk.domain.vo.AjaxResult;
import com.pig4cloud.pig.djjk.service.DispatchService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @className: DeviceController
 * @description: TODO 类描述
 * @author: liumingkun
 * @date: 2023/6/3
 **/
@RestController
@Inner(value = false)
@RequestMapping("/box")
public class WdboxEventController {
    Logger log = LoggerFactory.getLogger(WdboxEventController.class);

    @Autowired
	DispatchService dispatchService;

    @RequestMapping("/event/receiver")
    @ResponseBody
    public AjaxResult eventServerBox(@RequestBody JSONObject eventBody) {
        String receiveStr = eventBody.toString();
//        log.info(receiveStr);
        dispatchService.boxHandler(receiveStr);
        return AjaxResult.success();
    }

}
